package com.shqcjd.generalplatformprojectclient.ui.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.shqcjd.generalplatformprojectclient.R;
import com.shqcjd.generalplatformprojectclient.model.pojo.EquipmentOrTypeBean;

import java.util.List;

/**
 * 设备或设备类型适配
 * Created by sy on 2018/12/12.
 */

public class GuideEquipmentAdapter extends BaseQuickAdapter<EquipmentOrTypeBean, BaseViewHolder> {
    public GuideEquipmentAdapter(@Nullable List<EquipmentOrTypeBean> data) {
        super(R.layout.item_guide_equipment, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, EquipmentOrTypeBean item) {
        helper.setText(R.id.tv_type, item.tag == 1 ? "设备" : "设备类型")
                .setText(R.id.tv_title,item.name)
        .addOnClickListener(R.id.iv_select);

        helper.setImageResource(R.id.iv_select, item.isSelect == true ? R.mipmap.ic_select1 : R.mipmap.ic_no_select);
    }
}
